package com.frejoys.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.frejoys.common.dto.admin.UserLevelStoreMoneyLogListDto;
import com.frejoys.common.vo.admin.UserLevelStoreMoneyLogListVo;
import com.frejoys.dao.entity.UserLevelStoreMoneyLog;

import java.math.BigDecimal;

public interface UserLevelStoreMoneyLogService  extends IService<UserLevelStoreMoneyLog> {

    default UserLevelStoreMoneyLog getOnly(QueryWrapper<UserLevelStoreMoneyLog> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    default UserLevelStoreMoneyLog getOnly(LambdaQueryWrapper<UserLevelStoreMoneyLog> wrapper) {
        wrapper.last("limit 1");
        return this.getOne(wrapper);
    }

    /**
     * 添加信息
     * @param userId
     * @param storeId
     * @param drawSn
     * @param money
     * @param type
     * @return
     */
    boolean addInfo(Long userId, Integer storeId, Long drawSn, BigDecimal money, Integer type);

    // 用户店铺推广收益明细列表
    IPage<UserLevelStoreMoneyLogListVo> userLevelStoreMoneyLogListInfo(UserLevelStoreMoneyLogListDto dto);
}
